package cn.getech.data.metadata.db;

import cn.getech.data.metadata.entity.meta.CollectionTask;

public class PostgreSQLStructure extends DBStructure {
    public PostgreSQLStructure(String url, String username, String password, String driverClass, String dbName, CollectionTask collectionTask) {
        super(url, username, password, driverClass, dbName, collectionTask);

        rowAndLengthSql = "SELECT" +
                "(SELECT reltuples FROM pg_class r WHERE relkind = 'r' AND relname = '#{tableName}') tableRows," +
                "(SELECT pg_size_pretty(pg_total_relation_size('\"' || table_schema || '\".\"' || table_name || '\"')) FROM information_schema.tables WHERE table_schema='#{dbName}' AND table_name='#{tableName}')  AS dataLength";
    }
}
